﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;

namespace DARE
{
    public class CTextBoxData : CWidgetData
    {
        [ContentSerializerIgnore]
        public SpriteFont font;
        public bool readOnly;
        public bool verticalScrollbarEnabled;
        public Vector2 textPos;
        public float scale;
        public string text;

        public override void FillDataStructure(CWidget wid)
        {
            CTextBox w = wid as CTextBox;
            base.FillDataStructure(wid);
            font = w.Font;
            readOnly = w.m_readOnly;
            textPos = w.m_textPos;
            verticalScrollbarEnabled = w.m_VerticalScrollBarEnabled;
            scale = w.Scale;
            text = w.Text;
        }

        public override void FillFromDataStructure(ref CWidget wid, CHUDSystem hud)
        {
            base.FillFromDataStructure(ref wid, hud);
            (wid as CTextBox).m_readOnly = readOnly;
            (wid as CTextBox).m_VerticalScrollBarEnabled = verticalScrollbarEnabled;
            (wid as CTextBox).m_textPos = textPos;
            (wid as CTextBox).Scale = scale;
            (wid as CTextBox).Text = text;
        }
    }
}
